#include <init.h>
#include <system.h>

/*
	init_main - Main initialization routine. Sets up the environment expected by our kernel. 
	When the environment is set up, the kernel is loaded into memory and control is handed over to it.
*/
void init_main() {
	char *s = "Welcome to M3\n";
	char *s2 = "Copyright 2009 Peter C. de Tagyos\n";
	init_video();
	settextcolor(C_GREEN, C_BLACK);
	puts(s);
	settextcolor(C_WHITE, C_BLACK);
	puts(s2);	
	
	// Initialize GDT
	init_gdt();
	
	// Initialize IDT
	init_idt();
	
	// Setup Interrupt Handlers
	init_interrupt_handlers();
	
	// Setup Page Directory and Page Table
	// Turn on Paging
	init_paging();
		
	// Setup TSS for multitasking
	init_multitasking();
	
	// Load the kernel into memory
	load_kernel();
	
	// Initialization complete - hand over control to the kernel

	// TODO
}

void init_gdt() {
	// TODO
	
}

void init_idt() {
	// TODO
	
}

void init_interrupt_handlers() {
	// TODO
	
}

void init_paging() {
	// TODO
	
}

void init_multitasking() {
	// TODO
	
}

void load_kernel() {
	// TODO

}

